package com.huawei.java.tools.csvreaders;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author henrydai
 * @version 1.0
 * @date 2022/3/15 21:36
 * @description
 */
public class ConfigReader {
    /**
     * 读取config.ini中的qos限制
     * @param dir 路径
     * @return double qos限制值
     */
    public int readFile(String dir)
    {
        Path path = Paths.get(dir);
        try {
            BufferedReader br = Files.newBufferedReader(path);
            String s = br.readLine();
            s = br.readLine();
            String[] split = s.split("=");
            br.close();
            return Integer.parseInt(split[1]);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return 0;
    }
}
